/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.PintuanGoodsClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 拼团商品sdk熔断
 *
 * @author fk
 * @version v7.0
 * @date 20/4/17 下午3:15
 * @since v7.0
 */
@Component
public class PintuanGoodsClientFallbackFactory extends BaseFallbackFactory<PintuanGoodsClientFeignImpl> implements FallbackFactory {


    @Override
    protected PintuanGoodsClientFeignImpl fallback() {
        return new PintuanGoodsClientFallback();
    }

    /**
     * 拼团商品sdk熔断
     *
     * @author fk
     * @version v7.0
     * @date 20/4/17 下午3:15
     * @since v7.0
     */
    @Component
    public static class PintuanGoodsClientFallback implements PintuanGoodsClientFeignImpl {

        private final Logger logger = LoggerFactory.getLogger(getClass());

        @Override
        public boolean createGoodsIndex(Long promotionId) {

            logger.error("创建拼团索引出错");
            return false;
        }

        @Override
        public void deleteIndexByGoodsId(Long goodsId) {
            logger.error("删除拼团索引出错");
        }

        @Override
        public void syncIndexByGoodsId(Long goodsId) {
            logger.error("同步拼团索引出错");
        }

        @Override
        public void delete(Long goodsId) {
            logger.error("删除拼团商品错误");
        }

        @Override
        public void deletePinTuanGoods(List<Long> delSkuIds) {
            logger.error("deletePinTuanGoods出错");
        }
    }
}
